home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-15 | 1.6 KB | 49 lines | [TEXT/MPS ] |
- !!MP inlines.f
- C © Copyright 1991 Language Systems Corp.
- C All rights reserved.
-
- C Path.f 8/15/91
- C
- C This is a program that returns the full pathname of the textfile
- C that the user creates. This code runs under System 7 and later.
- C The source code uses the System 7 call FSMakeFSSpec to determine
- C the full source path of the chosen file. This code can be easily
- C modified to return the pathname of an already existing file.
- C The latest inlines and include files are needed in order for this
- C code to work.
-
- program testvol
- !!I StandardFile.f
- record /sftypelist/ mytypes
- record /standardfilereply/ thereply
- record /FSSpec/ myfilespec, scratchspec
- string*255 s,filename
-
- mytypes.OSTy(0) = 'TEXT'
- s = 'Name the new file'
- filename = 'Newfile'
- c Call StandardGetFile(nil,int2(1),mytypes,%ref(thereply))
- Call StandardPutFile(s,filename,%ref(thereply))
- If (thereply.sfgood = 0) go to 100
- myfilespec = thereply.sfFile
- filename = myfilespec.name
- write(*,*) 'The volume refnum is ',myfilespec.vrefnum
- write(*,*) 'The parent dir id is ',myfilespec.parID
- write(*,*) 'The name of the file is ',myfilespec.name
- write(*,*) 'Path name is ',filename
- 200 s = ''
- ierr = FSMakeFSSpec(myfilespec.vrefnum, myfilespec.parID, s,%ref(scratchspec))
- if (ierr .ne. 0) go to 300
- myfilespec = scratchspec
- filename = myfilespec.name // ":" // filename
- write(*,*) 'The volume refnum is ',myfilespec.vrefnum
- write(*,*) 'The parent dir id is ',myfilespec.parID
- write(*,*) 'The name of the folder is ',myfilespec.name
- write(*,*) 'Path name is ',filename
- go to 200
- 300 open(1,file=filename)
- write(1,*) 'testing'
- close(1)
- 100 continue
- end
-